{{extend "test_layout.html"}}

{{block sub_menu}}
{{sub_menu(menu_items, 'test', 'testplan')}}
{{end}}

{{block content_main}}
{{link "tforms.css"}}
<style type="text/css">
<!--
span.approve_status {margin-top:35px;padding:2px; background-color:#ccc; font-weight:bold;}
-->
</style>

<div class="content">
    <div class="box col_14">
        <h2>计划变更: {{=object.title}}</h2>
        <div class="box-body">
            {{<< view}}
        </div>
    </div>
    <div class="box col_14">
        <h2>变更内容</h2>
        <div class="box-body">
            <table class="table" width="100%">
                <thead>
                    <tr>
                        <th>字段名称</th>
                        <th>原值</th>
                        <th>新值</th>
                    </tr>
                </thead>
                <tbody>
                    {{<< diff_data}}
                </tbody>
            </table>
            <div class="box-bottom">
                <span class="approve_status rounded">{{= change.get_display_value('approve')}}</span>
                {{if change.approve != '0':}}由 <b>{{= change.get_display_value('approver')}}</b> 于 {{=change.get_display_value('approve_date')}} 审批
                {{pass}}
            </div>
        </div>
    </div>
    {{if has_permission(request.user, 'TestPlanChangeApprove') and change.approve in ('0',):}}
    <div class="box col_14">
        <h2>测试计划审批</h2>
        <div class="box-body">
            <a class="btn btn-green" href="/tests/plans/change_approve/{{=change.id}}?action=yes">批准</a>
            <a class="btn btn-blue" href="/tests/plans/change_approve/{{=change.id}}?action=no">拒绝</a>
        </div>
    </div>
    {{pass}}
</div>
{{end}}
